package com.oocl.crm.command.impl;

import com.oocl.crm.command.Command;
import com.oocl.crm.exception.ParameterErrorException;
import com.oocl.crm.util.StringUtil;

/**
 * D 指令
 * @author GANAB
 */
public class UpdateCommand extends Command{
	
	public UpdateCommand() {

	}
	
	public UpdateCommand(String params) {
		super(params);
	}
	
	/**
	 * 获取ID和后续参数
	 * @return
	 * @throws ParameterErrorException
	 */
	public String[] getUpdateField() throws ParameterErrorException{
		
		if(this.getParams()!=null){
			//分离ID和Fields
			String[] userIdAndFields = StringUtil.split(this.getParams());
			return userIdAndFields;
		}
		throw new ParameterErrorException("Update user exception: parameter does not conform to the format! ");
	}

}
